package com.cn.wanxi.thread;

public class MyRunnable implements Runnable {
    //    getName必须是Thread类才有，所以需要拿到当前线程对象
    private static Integer i = 10;

    @Override
    public void run() {
//        Thread thread=new Thread(this);
//        thread.getName();
        i--;
        System.out.println("线程名为：" + Thread.currentThread().getName() + " 开始执行;i=" + i);
        System.out.println("当前线程的优先级为:"+Thread.currentThread().getPriority());
    }
}
